<div class="layuimini-main">

    <div class="layui-form layuimini-form"  lay-filter="updateSubmit">
    	
    	 <input type="hidden" name="userId" >

        <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周一：上午</label>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup1" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown1" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>

         <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周二：上午</label>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup2" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown2" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>
        
         <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周三：上午</label>
		       <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup3" placeholder="0"  min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown3" placeholder="0" min="0"  autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>
        
         <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周四：上午</label>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup4" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown4" placeholder="0"  min="0" autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>
        
         <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周五：上午</label>
 				<div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup5" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown5" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>	
		    </div>
        </div>
        
        
          <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周六：上午</label>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup6" placeholder="0"  min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown6" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>
        
        
         <div class="layui-form-item">
           <div class="layui-inline">
		      <label class="layui-form-label">周日：上午</label>
		     <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="dayup7" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		      <div class="layui-form-mid">下午</div>
		      <div class="layui-input-inline" style="width: 100px;">
		        <input type="number" name="daydown7" placeholder="0" min="0" autocomplete="off" class="layui-input">
		      </div>
		    </div>
        </div>

     
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="updateSubmit">确认保存</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(updateSubmit)', function (data) {
        	console.log(data.field)
			var data=data.field;
			axios.post('setting/add',data).then(function(response){
				debugger
				if(response.data.code==200){
					layer.msg(response.data.msg);
					//重新加载表格
					window.reload()
				}
				//关闭弹出页面
				layer.close(parentIndex);
			}).catch(err=> {
						console.log(err);
					}
			);

            return false;
        });

    });
</script>